<h1>Welcome to your dashboard, <%=h @user.name %></h1>

<% cache do %>
<p style="display:none;">
	<%= link_to image_tag('../images/silk/email.png', :class=>'icon') + " Messages (0)", 'messages', :class=>'icon-link' %> <%=h link_to image_tag('../images/silk/cog.png', :class=>'icon') + " Settings", 'settings', :class=>'icon-link' %>
</p>
From here you'll be able to glance over your Expense and Chore overviews; click "expand" to see more details on each section. Still confused? Take the tour (coming soon) or read over our fabulous <%= link_to "FAQ", :faq %>!

<div id='expense-overview' class='overview'>
	<h2>Expenses Overview</h2>
	<p>
	<%= link_to image_tag('../images/silk/add.png', :class=>'icon') + " Create a new expense", 'expenses/new', :class=>'icon-link' %>
	
<% end %>
	<% form_tag(:controller =>"expenses", :action => "markpayment", :id=>0, :method => "get") do %>
	<span style="font-size: 11pt; margin-left: 5px;"><%= image_tag('../images/silk/money.png', :class=>'icon') %> Add Payment: </span>
	<%= select_tag :person, options_from_collection_for_select(@group_users, :id, :name) %> paid me 
	$<%= text_field_tag :amount, nil, :class=>'textField' %>
	<%= submit_tag "Go!", :id => "make_payment_button" %>
	<% end %>
	<%= link_to image_tag('../images/silk/hourglass.png', :class=>'icon') + " Payment History", :action=>"list_payment", :id => 0 %>
	</p>
	<div id="owe_others" class='sub-overview'>
		<h3>You owe other people: <%=h number_to_currency(@total_negative.to_s) %></h3>
		<% for user in @group_users %>
				<div class="owe_single">
					You owe <%=h user.name %>: <%=h number_to_currency (@user.owes(user)) %>
					<span class="con">
						<%= link_to image_tag('../images/silk/arrow_in.png', :class=>'icon') + ' Consolidate', :action=>:consolidate,:id=>user.id %>
					</span>
				</div>
		<% end %>

		<p>
		<%= link_to image_tag('../images/silk/magnifier.png', :class=>'icon') + " See details", :action=>"list_indv", :id=>1, :page=>1 %>
		</p>
	</div>

	<div id="others_owed" class='sub-overview'>
		<h3>
			People owe you: <%=h number_to_currency(@total_positive.to_s) %></h3>
	
		<% for user in @group_users %>
				<div class="owe_single">
					<%=h user.name %> owes you: <%=h number_to_currency(user.owes(@user)) %>
					<span class="con">
						<%= link_to image_tag('../images/silk/arrow_in.png', :class=>'icon') + ' Consolidate', :action=>:consolidate,:id=>user.id %>
					</span>
				</div>
		<% end %>
		
		<p>
			<%= link_to image_tag('../images/silk/magnifier.png', :class=>'icon') + ' See details', :action=>"list_indv", :id=>2, :page=>1%>
		</p>

	</div>
	<div id="group_expenses" class='sub-overview'>
		<h3>Recently added group expenses:</h3>
		<% for e in @recently_added_group %>
			<a id='expense-<%=h e.id %>' href="<%=h url_for e %>" class="expense-single span-hover"><div class="expense-span"><% image_tag('../images/silk/bullet_black.png', :class=>'icon') %> <%=h " " + format_date(e.created_at) + " - " + e.name + " by " + e.user.name %></div></a>
		<% end %>
		<p>
			<%= link_to image_tag('../images/silk/magnifier.png', :class=>'icon') + ' Show me more', :action=>"list_expense", :id=>0, :page=>1%>
		</p>
		
	</div>
</div>

<div id='chores-overview' class='overview'>
	<h2>Chores Overview</h2>
	Coming soon!
</div>